/*
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 2 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    2013 year
 *    Author: Esipenko Aleksey (Alexorleon)
 *    E-Mail: alexorleon@gmail.com
 */
#ifndef PAGEDATA_H
#define PAGEDATA_H

#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
#include <QTextTableCell>

//class QFont;
//class QPainter;
//class QPrinter;
//class QRect;
//class QTextCharFormat;
class QTextDocument;

struct OnePage
{
    QString dateCreate;
    QString performer;
    QString qrText;
    QList<QStringList> listPlace;
    QList<QStringList> listHistory;
};

class PageData : public QObject
{
    Q_OBJECT

public:
    explicit PageData();

    void createPage(const QStringList &list_1, const QStringList &list_2,
                    const QStringList &list_3);
    void populateDocument(QTextDocument *document);
    QString pageAsHtml(int page=0, bool selfContained=true);

    void setParameters(const QList<int> &list);
    void clearPages(){ pages.clear(); }

private:
    QString itemsAsHtmlTable(const OnePage &thePage);

    QList<OnePage> pages;
    QList<int> parameters;
};

#endif // PAGEDATA_H
